<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>智能问卷调查系统</title>
    <meta name="description" content="快速便捷的在线问卷调查，了解你的个性特质">
    <meta name="keywords" content="问卷调查,个性测试,在线调查,心理测评">
    <meta name="author" content="智能问卷系统">
    
    <!-- 微信分享优化 -->
    <meta property="og:title" content="智能问卷调查系统">
    <meta property="og:description" content="只需几分钟，深入了解你的个性特质">
    <meta property="og:type" content="website">
    <meta property="og:image" content="">
    
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 15px;
            color: #333;
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        .container {
            max-width: 420px;
            margin: 0 auto;
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.15);
            overflow: hidden;
            animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        @keyframes slideUp {
            from { 
                transform: translateY(30px); 
                opacity: 0; 
            }
            to { 
                transform: translateY(0); 
                opacity: 1; 
            }
        }
        
        .header {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            padding: 25px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
            animation: rotate 25s linear infinite;
        }
        
        @keyframes rotate {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .header h1 {
            font-size: 22px;
            margin-bottom: 8px;
            position: relative;
            z-index: 1;
            font-weight: 600;
        }
        
        .header p {
            font-size: 15px;
            opacity: 0.95;
            position: relative;
            z-index: 1;
        }
        
        .content {
            padding: 25px;
        }
        
        .survey-card {
            border: 2px solid #f0f2f5;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 16px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
        }
        
        .survey-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(79, 172, 254, 0.1), transparent);
            transition: left 0.6s ease;
        }
        
        .survey-card:hover::before {
            left: 100%;
        }
        
        .survey-card:hover {
            border-color: #4facfe;
            transform: translateY(-3px);
            box-shadow: 0 15px 40px rgba(79, 172, 254, 0.2);
        }
        
        .survey-card:active {
            transform: translateY(-1px);
        }
        
        .survey-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #4facfe, #00f2fe);
            border-radius: 50%;
            margin: 0 auto 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            box-shadow: 0 8px 25px rgba(79, 172, 254, 0.25);
            animation: pulse 3s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        .survey-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #333;
        }
        
        .survey-desc {
            font-size: 14px;
            color: #666;
            margin-bottom: 15px;
            line-height: 1.5;
        }
        
        .question-count {
            background: linear-gradient(45deg, #4facfe, #00f2fe);
            color: white;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            display: inline-block;
            box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
        }
        
        .question-container {
            display: none;
        }
        
        .question-container.active {
            display: block;
            animation: fadeIn 0.4s ease-in;
        }
        
        @keyframes fadeIn {
            from { 
                opacity: 0; 
                transform: translateX(15px); 
            }
            to { 
                opacity: 1; 
                transform: translateX(0); 
            }
        }
        
        .progress-bar {
            width: 100%;
            height: 8px;
            background: #e9ecef;
            border-radius: 4px;
            margin-bottom: 20px;
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(45deg, #4facfe, #00f2fe);
            border-radius: 4px;
            transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
        }
        
        .question-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-size: 14px;
            color: #666;
            font-weight: 500;
        }
        
        .question-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 24px;
            line-height: 1.6;
            text-align: left;
            color: #2c3e50;
        }
        
        .option {
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: left;
            font-size: 15px;
            line-height: 1.5;
            position: relative;
        }
        
        .option::before {
            content: '';
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            border: 2px solid #dee2e6;
            border-radius: 50%;
            background: white;
            transition: all 0.3s ease;
        }
        
        .option {
            padding-left: 50px;
        }
        
        .option:hover {
            background: #e3f2fd;
            border-color: #4facfe;
            transform: translateY(-1px);
            box-shadow: 0 4px 20px rgba(79, 172, 254, 0.15);
        }
        
        .option.selected {
            background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
            border-color: #4facfe;
            color: #1976d2;
            box-shadow: 0 6px 25px rgba(79, 172, 254, 0.2);
        }
        
        .option.selected::before {
            background: #4facfe;
            border-color: #4facfe;
            box-shadow: inset 0 0 0 4px white;
        }
        
        .scale-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 24px 0;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .scale-item {
            text-align: center;
            flex: 1;
            min-width: 60px;
        }
        
        .scale-button {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            border: 2px solid #dee2e6;
            background: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            margin: 0 auto 8px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 16px;
        }
        
        .scale-button:hover {
            border-color: #4facfe;
            background: #f0f8ff;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(79, 172, 254, 0.2);
        }
        
        .scale-button.selected {
            background: linear-gradient(135deg, #4facfe, #00f2fe);
            color: white;
            border-color: #4facfe;
            transform: scale(1.1);
            box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
        }
        
        .scale-label {
            font-size: 11px;
            color: #666;
            text-align: center;
            line-height: 1.3;
            font-weight: 500;
        }
        
        .text-input {
            width: 100%;
            padding: 16px;
            border: 2px solid #e9ecef;
            border-radius: 12px;
            font-size: 15px;
            resize: vertical;
            min-height: 120px;
            transition: all 0.3s ease;
            font-family: inherit;
            line-height: 1.5;
        }
        
        .text-input:focus {
            outline: none;
            border-color: #4facfe;
            box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
            background: #fafbfc;
        }
        
        .text-input::placeholder {
            color: #adb5bd;
        }
        
        .button-group {
            display: flex;
            justify-content: space-between;
            margin-top: 32px;
            gap: 12px;
        }
        
        .btn {
            padding: 14px 28px;
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            flex: 1;
            position: relative;
            overflow: hidden;
        }
        
        .btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.3s ease, height 0.3s ease;
        }
        
        .btn:active::before {
            width: 300px;
            height: 300px;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #4facfe, #00f2fe);
            color: white;
            box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 30px rgba(79, 172, 254, 0.4);
        }
        
        .btn-primary:active {
            transform: translateY(0);
        }
        
        .btn-secondary {
            background: #f8f9fa;
            color: #6c757d;
            border: 2px solid #dee2e6;
        }
        
        .btn-secondary:hover {
            background: #e9ecef;
            border-color: #adb5bd;
            transform: translateY(-1px);
        }
        
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }
        
        .results {
            display: none;
            text-align: center;
            padding: 24px;
        }
        
        .results.active {
            display: block;
            animation: fadeIn 0.6s ease-in;
        }
        
        .success-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #4caf50, #8bc34a);
            border-radius: 50%;
            margin: 0 auto 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            color: white;
            box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
            animation: bounce 2s infinite;
        }
        
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-8px); }
            60% { transform: translateY(-4px); }
        }
        
        .result-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin: 24px 0;
        }
        
        .stat-card {
            background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
            padding: 20px 16px;
            border-radius: 12px;
            text-align: center;
            border: 1px solid #e9ecef;
            transition: all 0.3s ease;
        }
        
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.1);
        }
        
        .stat-value {
            font-size: 28px;
            font-weight: 700;
            color: #4facfe;
            margin-bottom: 6px;
        }
        
        .stat-label {
            font-size: 13px;
            color: #6c757d;
            font-weight: 500;
        }
        
        .result-analysis {
            background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
            padding: 24px;
            border-radius: 16px;
            margin: 24px 0;
            text-align: left;
            border: 1px solid #e3f2fd;
        }
        
        .analysis-title {
            font-weight: 600;
            margin-bottom: 16px;
            color: #2c3e50;
            font-size: 16px;
        }
        
        .analysis-item {
            margin-bottom: 12px;
            font-size: 14px;
            line-height: 1.6;
            color: #495057;
        }
        
        .share-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }
        
        .share-btn {
            flex: 1;
            padding: 12px 16px;
            border: none;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .share-wechat {
            background: linear-gradient(135deg, #07c160, #05a050);
            color: white;
            box-shadow: 0 4px 15px rgba(7, 193, 96, 0.3);
        }
        
        .share-wechat:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(7, 193, 96, 0.4);
        }
        
        .share-moments {
            background: linear-gradient(135deg, #ff6b35, #f7931e);
            color: white;
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        }
        
        .share-moments:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
        }
        
        .hidden {
            display: none;
        }
        
        /* 移动端优化 */
        @media (max-width: 480px) {
            body {
                padding: 10px;
            }
            
            .container {
                margin: 0;
                border-radius: 12px;
            }
            
            .content {
                padding: 20px;
            }
            
            .scale-container {
                flex-wrap: wrap;
                gap: 12px;
            }
            
            .scale-item {
                flex: 0 0 calc(20% - 10px);
            }
            
            .button-group {
                flex-direction: column;
            }
            
            .btn {
                margin-bottom: 8px;
            }
        }
        
        /* 微信浏览器优化 */
        @media screen and (-webkit-min-device-pixel-ratio: 2) {
            .container {
                border-radius: 12px;
            }
            
            .survey-card, .option, .btn {
                border-radius: 10px;
            }
        }
        
        /* 打印样式 */
        @media print {
            .share-buttons, .btn-secondary {
                display: none;
            }
            
            body {
                background: white;
            }
            
            .container {
                box-shadow: none;
                border: 1px solid #ddd;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>📋 智能问卷调查</h1>
            <p>深入了解自己，发现更好的你</p>
        </div>
        
        <div class="content">
            <!-- 首页选择 -->
            <div id="home" class="page active">
                <div class="survey-card" onclick="startSurvey('personality')">
                    <div class="survey-icon">🧠</div>
                    <div class="survey-title">个性特质评估</div>
                    <div class="survey-desc">通过科学的测试题目，深入了解你的性格特点和行为倾向</div>
                    <span class="question-count">5个问题</span>
                </div>
                
                <div class="survey-card" onclick="startSurvey('satisfaction')">
                    <div class="survey-icon">⭐</div>
                    <div class="survey-title">服务满意度调查</div>
                    <div class="survey-desc">帮助我们了解您的使用体验，持续改善服务质量</div>
                    <span class="question-count">5个问题</span>
                </div>
                
                <div class="survey-card" onclick="startSurvey('learning')">
                    <div class="survey-icon">📚</div>
                    <div class="survey-title">学习习惯评估</div>
                    <div class="survey-desc">发现你的学习方式和偏好，提高学习效率</div>
                    <span class="question-count">5个问题</span>
                </div>
            </div>
            
            <!-- 问题页面 -->
            <div id="survey" class="page hidden">
                <div class="question-header">
                    <span id="question-progress">问题 1 / 5</span>
                    <span id="completion-percent">20%</span>
                </div>
                
                <div class="progress-bar">
                    <div class="progress-fill" id="progress-fill"></div>
                </div>
                
                <div id="question-container">
                    <!-- 问题内容将动态插入 -->
                </div>
                
                <div class="button-group">
                    <button class="btn btn-secondary" id="prev-btn" onclick="previousQuestion()">
                        ← 上一题
                    </button>
                    <button class="btn btn-primary" id="next-btn" onclick="nextQuestion()">
                        下一题 →
                    </button>
                </div>
            </div>
            
            <!-- 结果页面 -->
            <div id="results" class="page hidden">
                <div class="success-icon">✅</div>
                <h2 style="margin-bottom: 8px; font-size: 20px; color: #2c3e50;">测试完成！</h2>
                <p style="color: #6c757d; margin-bottom: 24px; font-size: 14px;">感谢您的参与，以下是您的详细分析结果</p>
                
                <div class="result-stats">
                    <div class="stat-card">
                        <div class="stat-value" id="completion-rate">100%</div>
                        <div class="stat-label">完成率</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-value" id="total-questions">5</div>
                        <div class="stat-label">总题数</div>
                    </div>
                </div>
                
                <div class="result-analysis">
                    <div class="analysis-title">📊 个性化分析报告</div>
                    <div id="analysis-content">
                        <!-- 分析内容将动态插入 -->
                    </div>
                </div>
                
                <div class="share-buttons">
                    <button class="share-btn share-wechat" onclick="shareToWechat()">
                        💬 分享给好友
                    </button>
                    <button class="share-btn share-moments" onclick="shareToMoments()">
                        🌟 分享到朋友圈
                    </button>
                </div>
                
                <button class="btn btn-primary" style="width: 100%; margin-top: 16px;" onclick="restartSurvey()">
                    🔄 重新测试
                </button>
            </div>
        </div>
    </div>

    <script>
        // 问卷数据
        const surveyData = {
            personality: {
                title: '个性特质评估',
                questions: [
                    {
                        type: 'single',
                        question: '在社交场合中，你通常会：',
                        options: [
                            { value: 'extrovert', label: '主动与他人交谈，享受热闹的氛围' },
                            { value: 'ambivert', label: '根据情况和心情决定是否主动社交' },
                            { value: 'introvert', label: '更喜欢安静观察，较少主动交流' }
                        ]
                    },
                    {
                        type: 'single',
                        question: '面对新的挑战或未知情况时，你的第一反应通常是：',
                        options: [
                            { value: 'excited', label: '感到兴奋和期待，迫不及待地开始' },
                            { value: 'cautious', label: '谨慎分析风险和机会，制定计划' },
                            { value: 'anxious', label: '感到紧张和担忧，需要时间适应' }
                        ]
                    },
                    {
                        type: 'multiple',
                        question: '你认为自己具备以下哪些特质？（可多选）',
                        options: [
                            { value: 'creative', label: '富有创造力和想象力' },
                            { value: 'analytical', label: '逻辑思维和分析能力强' },
                            { value: 